package com.duanjw.springframework.ioc.lifecycle.dao.impl;

import com.duanjw.springframework.ioc.lifecycle.dao.UserDao;
import org.springframework.stereotype.Repository;

/**
 * @author duanjw
 */
@Repository
public class UserDaoImpl2 implements UserDao {
    public UserDaoImpl2(){
        System.out.println("UserDaoImpl2空参构造初始化，hashCode：" + this.hashCode());
    }

    /**
     * bean初始化后执行的方法，
     * 使用注解`@postConstruct`，但是注意，该注解在jdk9已经被删除
     */
    // @PostConstruct
    public void init(){
        System.out.println("UserDaoImpl2的afterPropertiesSet方法，hashCode：" + this.hashCode());
    }
}
